package ${packageName};

/**
 * ${comments}
 * @author ${author}
 * @date ${.now?string("yyyy-MM-dd")}
 */
public class ${className} {

    public void setData(byte[] bytes) {
    <#list attrs as attr>
        <#if (attr.type == "byte")>
        this.set${attr.name}(bytes[${attr.offset}]);
        <#elseif (attr.type == "String")>
        this.set${attr.name}(ByteUtils.get${attr.type}WithIndex(bytes, ${attr.offset}, ${attr.length}));
        <#elseif (attr.type == "float")>
        this.set${attr.name}(ByteUtils.get${attr.type?cap_first}WithIndex(bytes, ${attr.offset}));
        <#else >
        this.set${attr.name}(ByteUtils.get${attr.type?cap_first}${attr.length*8}WithIndex(bytes, ${attr.offset}));
        </#if>
    </#list>
    }

    <#list attrs as attr>
    public ${attr.type} get${attr.name}() {
        return this.${attr.name};
    }

    public void set${attr.name}(${attr.type} ${attr.name}) {
        this.${attr.name} = ${attr.name};
    }

    </#list>

    <#list attrs as attr>
    /** ${attr.comments}  */
    private ${attr.type} ${attr.name};
    </#list>

}